---
title: "Get Agent Performance"
api: "GET https://api-v2.opencopilot.so/backend/reports/:orgId/agents/performance"
description: "Retrieve performance metrics for agents based on chat sessions"
---

This endpoint provides performance metrics for agents, including the total number of chats handled and their average duration. Performance in this context refers to the quantity of chats an agent manages and how quickly they resolve them.

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

### Path Parameters

<ParamField path="orgId" type="string" required>
  The unique identifier of the organization
</ParamField>

### Query Parameters

<ParamField query="startDate" type="string" format="date-time" optional>
  The start date for the report period (ISO 8601 format)
</ParamField>

<ParamField query="endDate" type="string" format="date-time" optional>
  The end date for the report period (ISO 8601 format)
</ParamField>

### Response

<ResponseField name="agent_id" type="number">
  The unique identifier of the agent
</ResponseField>

<ResponseField name="total_chats" type="number">
  The total number of chats handled by the agent
</ResponseField>

<ResponseField name="avg_duration" type="number">
  The average duration of chat sessions for the agent (in seconds)
</ResponseField>

<RequestExample>

```bash Example Request
curl --location --request GET 'https://api-v2.opencopilot.so/backend/reports/agents/performance?startDate=2023-01-01T00:00:00Z&endDate=2023-12-31T23:59:59Z' \
--header 'Authorization: Bearer YOUR_API_KEY'
```

</RequestExample>

<ResponseExample>

```json Response
[
  {
    "agent_id": 1,
    "total_chats": 150,
    "avg_duration": 420.5
  },
  {
    "agent_id": 2,
    "total_chats": 120,
    "avg_duration": 380.2
  }
]
```

</ResponseExample>